home *** CD-ROM | disk | FTP | other *** search
/ PC-X 1997 October / pcx14_9710.iso / swag / misc.swg / 0133_BASM Value Returns.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1995-05-26  |  706 b   |  26 lines

  1.  
  2. { Updated MISC.SWG on May 26, 1995 }
  3.  
  4. {
  5. From: anders@hk.super.net (Mr Anders Lee)
  6.  
  7. :>When I use a function like this:
  8. :>Function GetMode: Byte; Assembler;
  9.  
  10. :>Pascal doesn't want to let me assign a register to "GetMode" !
  11. :>i.e:
  12. :> ASM
  13. :>  Move GetMode, Al
  14. :> End;
  15.  
  16. You don't need to assign it to the function name as you does with
  17. standard pascal function.  SImply leave the value in AL (or AX, or
  18. DX:AX depending on the size) and the one calling it will pick up
  19. the value.
  20. For string result, you store the value to a pre-defined variable called
  21. Result, like this:
  22.  
  23.     LES DI,@Result   ; getting the address
  24.     MOV ES:[DI],AX   ; to put data to it
  25.     STOS is another method.
  26. }